Optimal. Leaf size=69 \[ a A x+\frac {(2 A b+2 a B+b C) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {(b B+a C) \tan (c+d x)}{d}+\frac {b C \sec (c+d x) \tan (c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 69, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.129, Rules used = {4133, 3855,
3852, 8} \begin {gather*} \frac {(2 a B+2 A b+b C) \tanh ^{-1}(\sin (c+d x))}{2 d}+a A x+\frac {(a C+b B) \tan (c+d x)}{d}+\frac {b C \tan (c+d x) \sec (c+d x)}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3852
Rule 3855
Rule 4133
Rubi steps
\begin {align*} \int (a+b \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\frac {b C \sec (c+d x) \tan (c+d x)}{2 d}+\frac {1}{2} \int \left (2 a A+(2 A b+2 a B+b C) \sec (c+d x)+2 (b B+a C) \sec ^2(c+d x)\right ) \, dx\\ &=a A x+\frac {b C \sec (c+d x) \tan (c+d x)}{2 d}+(b B+a C) \int \sec ^2(c+d x) \, dx+\frac {1}{2} (2 A b+2 a B+b C) \int \sec (c+d x) \, dx\\ &=a A x+\frac {(2 A b+2 a B+b C) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {b C \sec (c+d x) \tan (c+d x)}{2 d}-\frac {(b B+a C) \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{d}\\ &=a A x+\frac {(2 A b+2 a B+b C) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {(b B+a C) \tan (c+d x)}{d}+\frac {b C \sec (c+d x) \tan (c+d x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.04, size = 92, normalized size = 1.33 \begin {gather*} a A x+\frac {A b \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a B \tanh ^{-1}(\sin (c+d x))}{d}+\frac {b C \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {b B \tan (c+d x)}{d}+\frac {a C \tan (c+d x)}{d}+\frac {b C \sec (c+d x) \tan (c+d x)}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.06, size = 100, normalized size = 1.45
method | result | size |
derivativedivides | \(\frac {A b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+b B \tan \left (d x +c \right )+C b \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+a A \left (d x +c \right )+B a \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a C \tan \left (d x +c \right )}{d}\) | \(100\) |
default | \(\frac {A b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+b B \tan \left (d x +c \right )+C b \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+a A \left (d x +c \right )+B a \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a C \tan \left (d x +c \right )}{d}\) | \(100\) |
norman | \(\frac {a A x +\frac {\left (2 b B +2 a C +C b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+a A x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {\left (2 b B +2 a C -C b \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-2 a A x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {\left (2 A b +2 B a +C b \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {\left (2 A b +2 B a +C b \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) | \(166\) |
risch | \(a A x -\frac {i \left (C b \,{\mathrm e}^{3 i \left (d x +c \right )}-2 B b \,{\mathrm e}^{2 i \left (d x +c \right )}-2 C a \,{\mathrm e}^{2 i \left (d x +c \right )}-C b \,{\mathrm e}^{i \left (d x +c \right )}-2 b B -2 a C \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}+\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A}{d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B a}{d}+\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{2 d}-\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A}{d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B a}{d}-\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{2 d}\) | \(203\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 116, normalized size = 1.68 \begin {gather*} \frac {4 \, {\left (d x + c\right )} A a - C b {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 4 \, B a \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + 4 \, A b \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + 4 \, C a \tan \left (d x + c\right ) + 4 \, B b \tan \left (d x + c\right )}{4 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.70, size = 118, normalized size = 1.71 \begin {gather*} \frac {4 \, A a d x \cos \left (d x + c\right )^{2} + {\left (2 \, B a + {\left (2 \, A + C\right )} b\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (2 \, B a + {\left (2 \, A + C\right )} b\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (C b + 2 \, {\left (C a + B b\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sec {\left (c + d x \right )}\right ) \left (A + B \sec {\left (c + d x \right )} + C \sec ^{2}{\left (c + d x \right )}\right )\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 170 vs.
\(2 (65) = 130\).
time = 0.51, size = 170, normalized size = 2.46 \begin {gather*} \frac {2 \, {\left (d x + c\right )} A a + {\left (2 \, B a + 2 \, A b + C b\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (2 \, B a + 2 \, A b + C b\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (2 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2}}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.59, size = 164, normalized size = 2.38 \begin {gather*} \frac {2\,\left (A\,a\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )+A\,b\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )+B\,a\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )+\frac {C\,b\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{2}\right )}{d}+\frac {\frac {C\,b\,\sin \left (c+d\,x\right )}{2}+\frac {B\,b\,\sin \left (2\,c+2\,d\,x\right )}{2}+\frac {C\,a\,\sin \left (2\,c+2\,d\,x\right )}{2}}{d\,\left (\frac {\cos \left (2\,c+2\,d\,x\right )}{2}+\frac {1}{2}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________